package com.googlecode.spruce.core;

public class DefaultPluginResult implements ServiceCheckPluginResult
{
    /**
     * Serial ID
     */
    private static final long serialVersionUID = 1918406455437502986L;

    private final int value;
    private final String message;

    public DefaultPluginResult()
    {
        this(0, null);
    }

    public DefaultPluginResult(final String message)
    {
        this(0, message);
    }

    public DefaultPluginResult(final Throwable cause)
    {
        this(0, cause.getMessage());
    }

    public DefaultPluginResult(final int exitCode)
    {
        this(exitCode, null);
    }

    public DefaultPluginResult(final int value, final String message)
    {
        this.value = value;
        this.message = message;
    }

    /**
     * @return the value
     */
    public int getValue()
    {
        return value;
    }

    /**
     * @return the message
     */
    public String getMessage()
    {
        return message;
    }

}
